package com.donn.securitycontrolplatform;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import springfox.documentation.oas.annotations.EnableOpenApi;

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)//排除掉数据库自动加载
@EnableOpenApi
@Slf4j
@Configuration
@MapperScan(value = {"com.donn.securitycontrolplatform.db1.mapper","com.donn.securitycontrolplatform.db2.mapper"})
public class SecurityControlPlatformApplication {

    public static void main(String[] args) {
        log.info("唐恩和光定位系统，正在工作...");
        SpringApplication.run(SecurityControlPlatformApplication.class, args);
        //起socket服务,监听传感器发送过来的数据
        SocketServer server = new SocketServer();
        server.startSocketServer(9921);
    }

    @Bean
    public CommonsMultipartResolver multipartResolver() {
        CommonsMultipartResolver resolver = new CommonsMultipartResolver();
        resolver.setDefaultEncoding("utf-8");
        resolver.setMaxInMemorySize(10240);
        resolver.setMaxUploadSize(-1);
        return resolver;
    }


}




